import requests
# from requests.packages.urllib3.exceptions import InsecureRequestWarning
from urllib3.exceptions import InsecureRequestWarning

 
# res = requests.get('http://www.baidu.com')
# print(res)

# params = {"name": "baidu", "age": "hh", "dd": ["sdd", "ddd", "ef"]}
# res = requests.get('http://httpbin.org/get', params=params)
# print(res.url)

# res = requests.get('http://www.baidu.com')
# print(res.text)
#
# url = "http://www.baidu.com"
# headers = {
#     'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) '
#                   'AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36'
# }
# res = requests.get(url, headers=headers)
# print(res)

# cookies = {
#     'cookies1': 'class_37'
# }
# url = 'http://httpbin.org/cookies'
# res = requests.get(url, cookies=cookies)
# print(res.text)

# proxies = {
#     'http': 'http://10.10.1.10:3128',
#     'https': 'http://10.10.1.10:1080'
# }
# res = requests.get('http://example.org', proxies=proxies)
# print(res.text)

# res = requests.get('http://github.com', allow_redirects=False)
# print(res.status_code)

# resp = requests.get('http://www.baidu.com/post', verify=False)
# print(resp)

# res = requests.get('https://api.github.com/events')
# res = requests.get('https://www.baidu.com')
# res.encoding = 'utf-8'
# print(res.text)
# 二进制
# 图片传输（编码）bases64
# print(res.content)
# json
res = requests.get('https://image.baidu.com/search/index?tn=baiduimage&ct=201326592&lm=-1&cl=2&ie=gb18030&word=%B0%D9%B6%C8%CD%BC%C6%AC&fr=ala&ala=1&alatpl=adress&pos=0&hs=2&xthttps=111111')
# print(res.json())

# cookie
# print(res.cookies)
# headers
# print(res.headers)
# url
# print(res.u rl)
# 状态码

















































